<?php 
namespace app\admin\controller;
use think\Controller;
use think\Session;

//登录页面展示
class AdminBase extends Controller{

        public $UserID;
        public $UserName;
        public $UserStatus;

	public function __construct(){



    	parent::__construct();
        $UserID = Session::get('userid');
        $UserName = Session::get('username');
        $UserStatus = Session::get('userstatus');


        if (empty($UserID) || empty($UserName)) {
        	$this->redirect("Login/index");
        }else{
        	$this->assign('username',$UserName);
        	$this->assign('userid',$UserID);
        }

        $this->AA($UserStatus);
    }

    public function AA($UserStatus){

           if($UserStatus != 2){
           
           //没有进入后台的权限
           $this->error("没有权限进入后台,IP已被记录","Login/index"); 
        } 
    }
}